<template>
	<div class="banner">
		<el-carousel height="33.125rem" :indicator-position="'none'">
			<!-- <el-carousel-item>
				<el-image :src="banner" alt="" class="image" fit="fill" />
			</el-carousel-item> -->
			<el-carousel-item v-for="(item, index) in list" :key="index">
				<el-image :src="item" alt="" class="image" fit="fill" />
			</el-carousel-item>
		</el-carousel>
	</div>
</template>

<script>
	export default {
		name: "Banner",
		data() {
			return {
				list: [],
				banner: [],
			};
		},
		methods: {
			// getData(id) {
			//   let params = {
			//     id: id,
			//   };
			//   this.$api.home.tagDetail(params).then((res) => {
			//     if (res.code == 1) {
			//       console.log('获取列表')
			//       this.list = res.data;
			//     }
			//   });
			// },
			getData(id, shop_id) {
				let params = {
					shop_id: shop_id
				}
				this.$api.commit.ShopsShow(params).then((res) => {
					if (res.code == 1) {
						this.banner = res.data.head_image
					}
				});

				let data = {
					id: id,
				};
				this.$api.home.tagDetail(data).then((res) => {
					if (res.code == 1) {
						console.log('获取列表')
						this.list = res.data;
						// this.banner = "http://upmallfiles.yonyouup.com/d7cf1d9d-23a4-46dc-a90d-558a38654727.png";
					}
				});

			},
		},
	};
</script>

<style scoped lang="scss">
	.banner {
		//height: 530px;
		overflow: hidden;
		position: relative;
		margin-top: 6.18rem;
		.image {
			width: 100%;
			height: 100%;
		}
	}
</style>
